<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>array.html</title>

<script>
var array = new Array();
var cnt=0;
function save(){//입력상자의 값을 배열에 추가.
	var temp=document.getElementById("data").value;
	array[cnt]=temp;
	cnt++;
}

function print(){
	var r= document.getElementById("result");
	r.value=array.join("\n");
}

</script>
</head>

<body>

<input type='text' id='data'>
<input type='button' value='저장' onclick='save()' id='btnSave'>
<input type='button' value='출력' onclick='print()' id='btnPrint'>
<p/>
<textarea rows="10" cols="80" id='result'></textarea>


</body>
</html>